package cn.itsource.ymcc.feign;

import cn.itsource.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseFeignFallbackFactory implements FallbackFactory<CourseFeign> {


    @Override
    public CourseFeign create(Throwable throwable) {
        return new CourseFeign() {
            @Override
            public JSONResult getAbleMovie(Long courseId, Long loginId) {
                throwable.printStackTrace();
                return JSONResult.error("feigh错误，降级");
            }

            @Override
            public JSONResult info(String id) {
                throwable.printStackTrace();
                return JSONResult.error("feigh错误，降级");
            }

            @Override
            public JSONResult infoKill(String id, String orderNo) {
                throwable.printStackTrace();
                return JSONResult.error("feigh错误，降级");
            }
        };
    }
}
